import random


# 生成十六进制数
def random_str():
    a = random.randint(0, 16)
    if a >= 10:
        str1 = (hex(a)[-1]).upper()
        return str1
    else:
        str1 = str(a)
        return str1


# 01-AF-3B  -11-A2-B3
with open("mac.txt", "w+") as f:
    for i in range(100):
        mac_str = "01-AF-3B"
        # 生成mac地址
        for j in range(9):
            if j % 3 == 0:
                mac_str = mac_str + '-'
            else:
                str1 = random_str()
                mac_str = mac_str + str1
        f.write(mac_str + "\n")
f.close()
